package com.hmdp.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedisConfig {
    @Bean
    public RedissonClient redissonClient() {
        // 配置类
        Config config = new Config();
        // 单体地址，如果redis是集群的话，还可以添加集群地址
        config.useSingleServer().setAddress("redis://192.168.109.128:6379").setPassword("123456");

        return Redisson.create(config);
    }
}
